home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 385 / prg_1 / prg_1dp.s < prev    next >
Text File  |  1985-11-19  |  2KB  |  54 lines

  1.  ; Program Name: PRG_1DP.S
  2.  ;      Version: 1.002
  3.  
  4.  ; Assembly Instructions:
  5.  
  6.  ;    Assemble in PC-relative mode and save with PRG and TOS extensions.
  7.  
  8.  ; Program Function: 
  9.  
  10.  ;    Prints a newline (combination of a carriage return and a linefeed)
  11.  ; to the video screen before it prints a string.  This added feature
  12.  ; prevents the string from overwriting the AssemPro debugger screen, if
  13.  ; the Save Screen debugger option is chosen before the assembled program
  14.  ; is relocated with the Relocate option or before it is loaded with the
  15.  ; Execute Program option.
  16.  
  17.  ;    After the string has been written, the program waits until a key is
  18.  ; pressed on the keyboard.  When that event occurs, it returns control to
  19.  ; AssemPro.
  20.  
  21.  ; Note - We have not defined a program stack.  We are using the default
  22.  ;        system stack located at $4DB8, according to Internals p. 276.
  23.  
  24. print_newline:                  ; Prints a carriage return and linefeed.
  25.  pea        newline             ; Push address of string onto stack.
  26.  move.w     #9, -(sp)           ; Function = c_conws = GEMDOS $9.
  27.  trap       #1                
  28.  addq.l     #6, sp
  29.  
  30. print_string:
  31.  pea        string              ; Push address of the string onto stack.
  32.  move.w     #9, -(sp)           ; Function = c_conws = GEMDOS $9.
  33.  trap       #1                
  34.  addq.l     #6, sp            
  35.  
  36. wait_for_keypress: 
  37.  move.w     #8, -(sp)           ; Function = c_necin = GEMDOS $8.
  38.  trap       #1                
  39.  addq.l     #2, sp            
  40.  
  41. terminate:
  42.  move.w    #0, -(sp)            ; Function = p_term_old = GEMDOS $0.
  43.  trap      #1                 
  44.  
  45.  data
  46. newline: dc.b $D,$A,0  ; All strings must be NULL terminated because the
  47.                        ; function we are used to print them requires it.
  48. string:  dc.b 'This string will not overwrite the AssemPro debugger screen.'
  49.          dc.b $D,$A,0  ; The string is continued on this line.  Here, we
  50.                        ; declare a carriage return, linefeed and terminate
  51.                        ; the entire string with a NULL = 0.
  52.  end               
  53.  
  54.